package com.gc.ip.util;

import java.util.ArrayList;
import java.util.List;

import com.gc.ip.IPAddress;


public class CheckIPUtils
{
	public static List<IPAddress> checkDuplication(List<IPAddress> ipAddressList)
	{
		if(ipAddressList == null || ipAddressList.isEmpty())
		{
			return null;
		}
		//TODO
		
		//TEST CODE HERE
		List<IPAddress> duplication = new ArrayList<IPAddress>();
		for(IPAddress ipAddress : ipAddressList)
		{
			byte[] bytesAddr = ipAddress.getBytesAddr();
			if(bytesAddr == null || bytesAddr.length <= 0)
			{
				continue;
			}
			if(bytesAddr[0] > 64)
			{
				duplication.add(ipAddress);
			}
		}
		return duplication;
	}
}
